//
//  receiveFirCirNewNews.m
//  tcpoctest
//
//  Created by apple on 13-5-2.
//  Copyright (c) 2013年 gump. All rights reserved.
//

#import "receiveFirCirNewNews.h"
#import "FirendCircleDataSource.h"
#import "FirCirNewsDataSource.h"
#import "firendCircledb.h"

#import "FirCirMailNewsdb.h"
#import "FirCirNewsMailDataSource.h"

#import "sendMessageReceipt.h"

@implementation receiveFirCirNewNews

-(void)processreceive
{
    //收到 74char(1),15char(1),用户名长度char(1), 用户名char(x),动态id字串长度char(1), 动态id字串char(x),
    
    NSString *mail = [logicsb ReadUnencodeString];
    NSString *newid = [logicsb ReadUnencodeString];

    [[DataControl shareControl].fircirDS AddFirCirArrFirst:newid];
    [[DataBaseCtrol shareControl].fircirdatabase insertFC:newid];

    [[DataControl shareControl].fcnewsmailDS AddMail:mail withNewsID:newid];
    [[DataBaseCtrol shareControl].fircirmailnewsdatabase insertNewMail:newid
                                                          withMail:mail];

    [[DataControl shareControl].UICommendDS addUICommand:UC_REFRESHCURVIEW];
    
    NSString *strid = [logicsb ReadUnencodeString];
    
    [[netManager sharedNetManager].sendMsgReceipt SendMegReceipt:strid];
    
    [DataControl shareControl].fircirDS.newmail = mail;
    [DataControl shareControl].fircirDS.bShowBadge = true;
    
    [[DataControl shareControl].UICommendDS addUICommand:UC_FIRCIR_BADGE];

    [self ShowLog];
}

@end
